package com.zl.gmadmin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zl.gmadmin.common.ApiResponse;
import com.zl.gmadmin.payload.WorkflowQueryCriteria;
import com.zl.gmadmin.service.WorkflowDemoService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: ZhangLiang
 * @Date: 2021/09/17/14:52
 * @Description:  流程提交审核demo，这里就以一个出差申请为例来提交审核
 */
@Api(tags = "流程提交审核demo")
@RestController
@RequestMapping("api/unit/activiti-demo")
public class WorkflowDemoController {

    private final WorkflowDemoService service;

    public WorkflowDemoController(WorkflowDemoService service) {
        this.service = service;
    }

    /**
     *
     * @return
     */
    @GetMapping
    public ApiResponse getWorkflowDemo(WorkflowQueryCriteria criteria, Page page){

       return ApiResponse.ofSuccess(service.selectPage(criteria,page));
    }
}
